﻿using System;
using System.Collections;
using System.Text;
using Framework;
using Framework.Domain;
using Contract.IService;

namespace BaseService
{
    public class DaoService : BaseService<Framework.Domain.Entity>, IDaoService
    {
       public int GetTotalCount(QueryInfo info)
       {
           return Dao.GetTotalCount(info);
       }
        public object FindById(string typeName, object Id)
        {
            //Type type = Type.GetType(typeName);
            //if (type == null)
            //    throw new ArgumentNullException(typeName);
            QueryInfo info = new QueryInfo();
            info.QueryObject = typeName;
            info.AddParam("Id", Id);
         return  Dao.FindOne(info);
        }
        public object FindOne(QueryInfo info)
        {
            return Dao.FindOne(info);
        }
        public IList FindList(QueryInfo info)
        {
            return Dao.FindList(info);
        }
        public QueryInfo FindByQueryInfo(QueryInfo info)
        {
            return Dao.FindByQueryInfo(info);
        }

        public int ExecuteUpdate(QueryInfo info)
        {
            return Dao.ExecuteUpdate(info);
        }

        public int ExecuteNonQuery(QueryInfo info)
        {
            return Dao.ExecuteNonQuery(info);
        }


        public object SaveOrUpdate(object obj)
        {
            return Dao.SaveOrUpdate(obj);
        }
        public System.Data.DataSet ExcuteDataSet(QueryInfo info)
        {
            return Dao.ExecuteDataSet(info);
        }
        public object ExecuteScare(QueryInfo info)
        {
            return Dao.ExecuteScalar(info);
        }
        public IList SaveOrUpdateAll(IList list)
        {
            return Dao.SaveOrUpdateAll(list);
        }
    }
}
